{php include wl_template('common/header');}
<style type='text/css'>
.trhead td{background:#efefef;text-align: center}
.trbody td{text-align: center;vertical-align:top;border-left:1px solid #f2f2f2;overflow: hidden;font-size:12px;}
.trorder{background:#f8f8f8;border:1px solid #f2f2f2;text-align:left;}
.ops{border-right:1px solid #f2f2f2;text-align: center;}
.ops a,.ops span{margin: 3px 0;}
.table-top{padding: 0 20px;background: #f7f7f7;border-bottom: 1px solid #e5e5e5;}
.table-top .op:hover{color: #000;}
.tables{border:1px solid #e5e5e5;font-size: 14px;line-height: 18px;}
.tables:hover{border:1px solid #1ab394;}
.table-row,.table-header,.table-footer,.table-top{display: -webkit-box;display: -webkit-flex;display: -ms-flexbox;display: flex;justify-content: center;-webkit-justify-content: center;-webkit-align-content: space-around;align-content: space-around;}
.tables .table-row.table-top>div{padding: 10.5px 0;}
.tables .table-row .ops.list-inner{border-right:none;}
.tables .table-row .buyremark{background:#fdeeee;color:red;flex: 1;padding: 10px 20px!important;}
.tables .table-row .remark{background:#ffffcc;color:red;flex: 1;padding: 10px 20px!important;}
.tables .list-inner{border-right: 1px solid #efefef;vertical-align: middle;}
.table-row .goods-des .title{width:180px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
.table-row .goods-des{border-right: 1px solid #efefef;vertical-align: middle;width:400px;text-align: left;padding: 14px 0;}
.table-row .list-inner{-webkit-box-flex: 1;-webkit-flex: 1;-ms-flex: 1;flex: 1;text-align: center;display: -webkit-box;display: -webkit-flex;display: -ms-flexbox;display: flex;-webkit-align-items: center;align-items: center;-webkit-justify-content: center;justify-content: center;-webkit-flex-direction: column;flex-direction: column;}
.saler>div{width:130px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
.table-row .list-inner.ops, .table-row .list-inner.paystyle{-webkit-flex-direction: column;flex-direction: column;-webkit-justify-content: center;justify-content: center;}
.table-header{background:#f8f8f8;height: 40px;line-height: 40px;padding: 0 20px;font-weight: 600;}
.table-header .others{-webkit-box-flex: 1;-webkit-flex: 1;-ms-flex: 1;flex: 1;text-align: center;}
.table-footer{border-top: 1px solid #efefef;margin:0 20px;padding: 10.5px 0;}
.table-footer>div, .table-top>div{-webkit-box-flex: 1;-webkit-flex: 1;-ms-flex: 1;flex: 1;height:100%;}
.fixed-header div{padding:0;}
.fixed-header.table-header{display: none;}
.fixed-header.table-header.active{display: -webkit-box;display: -webkit-flex;display: -ms-flexbox;display: flex;}
.shop{display: inline-block;width:48px;height:18px;text-align: center;border:1px solid #1b86ff;color: #1b86ff;margin-right: 10px;}
.min_program{display: inline-block;width:48px;height:18px;text-align: center;border:1px solid #ff5555;color: #ff5555;margin-right: 10px;}
.ordertype{display: inline-block;height:18px;margin-right: 10px;border-radius: 0;font-weight: 500;}
.popover{border: 1px solid #efefef;border: 1px solid #efefef;border-radius: 6px;-webkit-filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.1));-moz-filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .1));-o-filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .1));filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.1));padding: 0!important;}
.popover-content{padding: 10px!important;font-size:12px;}
.popover-content table{margin-bottom: 0!important;}
.popover.right>.arrow{border-right-color: #efefef;}
.cored{color: orangered;}
</style>
<ul class="nav nav-tabs">
	<li class="active"><a href="javascript:;">商品订单</a></li>
</ul>
<div class="app-content">
	<div class="app-filter">
        <div class="alert alert-warning">
	            注意一：批量发货功能在同一时间最大处理单数是999单，超过将出现不可估计的错误!<br />
	          	注意二：批量发货表中填写的物流公司名称需要与确认返回中的物流名称一致，否则将发货失败!<br />
            	注意三：请将批量发货表中的单元格的格式设置为文本格式,否则可能读取错误导致发货失败!<br />
				注意四：订单统计信息仅统计商品信息(抢购、团购、卡券、砍价、拼团、活动、酒店、同城配送)<br />
				注意五：要导出订单的自定义表单下单填写内容需要先筛选商品类型和商品ID，只能一个商品一个商品的单独导出。
        </div>
		<div class="filter-action">
			当前订单:<span class="cored">{$total}</span>个，<!--共计商品<span class="cored">{$goodtotal}</span>份，--><span class="cored">{$allprice}</span>元;
		</div>
		<div class="filter-list">
			<form action="" method="get" class="form-horizontal" role="form" id="form1">
				<input type="hidden" name="c" value="site" />
				<input type="hidden" name="a" value="entry" />
				<input type="hidden" name="m" value="{MODULE_NAME}" />
				<input type="hidden" name="p" value="order" />
				<input type="hidden" name="ac" value="wlOrder" />
				<input type="hidden" name="do" value="orderlist" />
				<input type="hidden" name="plugin" value="{$_GPC['plugin']}" />
				<input type="hidden" name="paytype" value="{$_GPC['paytype']}" />
				<input type="hidden" name="status" value="{$_GPC['status']}" />
				<input type="hidden" name="fightgroupid" value="{$_GPC['fightgroupid']}" />
				<input type="hidden" name="agentid" value="{$_GPC['agentid']}" />
				<div class="form-group" style="max-width: 1180px;">
					<label class="col-sm-2 control-label">订单状态</label>
					<div class="col-sm-9">
						<div class="btn-group">
							<a href="{php echo wl_filter_url('status:');}" class="btn {if empty($_GPC['status'])}btn-primary{else}btn-default{/if}">不限</a>
							<a href="{php echo wl_filter_url('status:zero');}" class="btn {if $_GPC['status'] == 'zero'}btn-primary{else}btn-default{/if}">未支付</a>
							<a href="{php echo wl_filter_url('status:11');}" class="btn {if $_GPC['status'] == '11'}btn-primary{else}btn-default{/if}">已支付</a>
							<a href="{php echo wl_filter_url('status:1');}" class="btn {if $_GPC['status'] == '1'}btn-primary{else}btn-default{/if}">待核销</a>
							<a href="{php echo wl_filter_url('status:8');}" class="btn {if $_GPC['status'] == '8'}btn-primary{else}btn-default{/if}">待发货</a>
							<a href="{php echo wl_filter_url('status:4');}" class="btn {if $_GPC['status'] == '4'}btn-primary{else}btn-default{/if}">待收货</a>
							<a href="{php echo wl_filter_url('status:2');}" class="btn {if $_GPC['status'] == '2'}btn-primary{else}btn-default{/if}">待评价</a>
							<a href="{php echo wl_filter_url('status:3');}" class="btn {if $_GPC['status'] == '3'}btn-primary{else}btn-default{/if}">已评价</a>
							<a href="{php echo wl_filter_url('status:5');}" class="btn {if $_GPC['status'] == '5'}btn-primary{else}btn-default{/if}">已取消</a>
							<a href="{php echo wl_filter_url('status:6');}" class="btn {if $_GPC['status'] == '6'}btn-primary{else}btn-default{/if}">待退款</a>
							<a href="{php echo wl_filter_url('status:7');}" class="btn {if $_GPC['status'] == '7'}btn-primary{else}btn-default{/if}">已退款</a>
							<a href="{php echo wl_filter_url('status:9');}" class="btn {if $_GPC['status'] == '9'}btn-primary{else}btn-default{/if}">已过期</a>
							<a href="{php echo web_url('order/orderAfterSales/afterlist');}" class="btn btn-default">申请退款</a>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">订单类型</label>
					<div class="col-sm-9">
						<div class="btn-group">
							<a href="{php echo wl_filter_url('plugin:');}" class="btn {if empty($_GPC['plugin'])}btn-primary{else}btn-default{/if}">不限</a>
							<a href="{php echo wl_filter_url('plugin:rush');}" class="btn {if $_GPC['plugin'] == 'rush'}btn-primary{else}btn-default{/if}">抢购</a>
							<a href="{php echo wl_filter_url('plugin:groupon');}" class="btn {if $_GPC['plugin'] == 'groupon'}btn-primary{else}btn-default{/if}">团购</a>
							<a href="{php echo wl_filter_url('plugin:wlfightgroup');}" class="btn {if $_GPC['plugin'] == 'wlfightgroup'}btn-primary{else}btn-default{/if}">拼团</a>
							<a href="{php echo wl_filter_url('plugin:coupon');}" class="btn {if $_GPC['plugin'] == 'coupon'}btn-primary{else}btn-default{/if}">卡券</a>
							{if agent_p('bargain')}
							<a href="{php echo wl_filter_url('plugin:bargain');}" class="btn {if $_GPC['plugin'] == 'bargain'}btn-primary{else}btn-default{/if}">砍价</a>
							{/if}
							{if agent_p('activity')}
							<a href="{php echo wl_filter_url('plugin:activity');}" class="btn {if $_GPC['plugin'] == 'activity'}btn-primary{else}btn-default{/if}">活动</a>
							{/if}
							{if agent_p('hotel')}
							<a href="{php echo wl_filter_url('plugin:hotel');}" class="btn {if $_GPC['plugin'] == 'hotel'}btn-primary{else}btn-default{/if}">酒店</a>
							{/if}
							{if agent_p('citydelivery')}
							<a href="{php echo wl_filter_url('plugin:citydelivery');}" class="btn {if $_GPC['plugin'] == 'citydelivery'}btn-primary{else}btn-default{/if}">同城配送</a>
							{/if}
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">支付方式</label>
					<div class="col-sm-9">
						<div class="btn-group">
							<a href="{php echo wl_filter_url('paytype:0');}" class="btn {if intval($_GPC['paytype']) == 0}btn-primary{else}btn-default{/if}">不限</a>
							<a href="{php echo wl_filter_url('paytype:2');}" class="btn {if $_GPC['paytype'] == 2}btn-primary{else}btn-default{/if}">微信支付</a>
							<a href="{php echo wl_filter_url('paytype:1');}" class="btn {if $_GPC['paytype'] == 1}btn-primary{else}btn-default{/if}">余额支付</a>
							<a href="{php echo wl_filter_url('paytype:3');}" class="btn {if $_GPC['paytype'] == 3}btn-primary{else}btn-default{/if}">支付宝</a>
						</div>
					</div>
				</div>
				{if empty($_W['aid'])}
				<div class="form-group form-inline">
					<label class="col-sm-2 control-label">所属代理</label>
					<div class="col-sm-9">
						<select name="agentid" class="form-control" style="width: 300px;">
							<option value="0" {if empty($_GPC['agentid'])}selected="selected"{/if}>所有代理</option>
							<option value="-1" {if $_GPC['agentid']== -1 }selected="selected"{/if}>总后台</option>
							{loop $agentlist $agent}
							<option value="{$agent['id']}" {if $_GPC['agentid' ]== $agent['id']  }selected="selected"{/if}>{$agent['agentname']}</option>
							{/loop}
						</select>
					</div>
				</div>
				{/if}
				<div class="form-group form-inline">
					<label class="col-sm-2 control-label">订单搜索</label>
					<div class="col-sm-9">
						<select name="keywordtype" class="form-control">
							<option value="1" {if $_GPC['keywordtype']==1}selected="selected"{/if}>订单号</option>
							{if !is_store()}
							<option value="4" {if $_GPC['keywordtype']==4}selected="selected"{/if}>商户ID</option>
							{/if}
							<option value="2" {if $_GPC['keywordtype']==2}selected="selected"{/if}>商品ID</option>
							<option value="11" {if $_GPC['keywordtype']==11}selected="selected"{/if}>商品名</option>
							<option value="3" {if $_GPC['keywordtype']==3}selected="selected"{/if}>买家ID</option>
							<option value="5" {if $_GPC['keywordtype']==5}selected="selected"{/if}>买家昵称</option>
							<option value="13" {if $_GPC['keywordtype']==13}selected="selected"{/if}>收货人姓名</option>
							<option value="6" {if $_GPC['keywordtype']==6}selected="selected"{/if}>买家电话</option>
							<option value="9" {if $_GPC['keywordtype']==9}selected="selected"{/if}>预留电话</option>
							<option value="12" {if $_GPC['keywordtype']==12}selected="selected"{/if}>收货人电话</option>
							{if !is_store()}
							<option value="7" {if $_GPC['keywordtype']==7}selected="selected"{/if}>商家名称</option>
							{/if}
                            <option value="8" {if $_GPC['keywordtype']==8}selected="selected"{/if}>核销码</option>
							{if p('salesman')}
							<option value="10" {if $_GPC['keywordtype']==10}selected="selected"{/if}>业务员ID</option>
							{/if}
							<option value="14" {if $_GPC['keywordtype']==14}selected="selected"{/if}>快递单号</option>
						</select>
						<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}"  placeholder="请输入关键字"/>
	                </div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">时间筛选</label>
					<div class="col-md-3">
						<select name="timetype" class="form-control">
							<option value="">请选择时间类型</option>
							<option value="1" {if $_GPC['timetype']==1}selected="selected"{/if}>下单时间</option>
							<option value="2" {if $_GPC['timetype']==2}selected="selected"{/if}>支付时间</option>
						</select>
                    </div>
					<div class="col-md-2">
						{php echo tpl_select_time_info('time_limit', array('starttime' => date('Y-m-d H:i',$starttime), 'endtime' => date('Y-m-d H:i', $endtime)));}
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-9">
						<button class="btn btn-primary" id="search">筛选</button>
                        <button class="btn btn-warning min-width" onclick="$('#excelUpload').click();return false;"><i class="fa fa-upload"></i>  批量发货</button>
                        <input type="file" id="excelUpload" class="hide"/>
						<button class="btn btn-default min-width" name="export" type="submit" value="export"><i class="fa fa-download"></i>  导出记录</button>
                    </div>
				</div>
			</form>
		</div>	
	</div>	
	<div class="app-table-list">
		<div class="row">
	        <div class="col-md-12">
	            <div class="">
	                <div class="table-header">
	                    <div style='width: 400px;text-align: left;'>商品</div>
						{if empty($_W['aid'])}
						<div class="others">所属代理</div>
						{/if}
	                    <div class="others">买家</div>
	                    <div class="others">支付/配送</div>
	                    <div class="others">价格</div>
	                    <div class="others">操作</div>
	                    <div class="others">状态</div>
	                </div>
	            	{loop $orderlist $item}
	            	<div class="table-row"><div style='height:20px;padding:0;border-top:none;'>&nbsp;</div></div>
	                <div class="tables">
	                    <div class='table-row table-top'>
	                        <div style="text-align: left;color: #8f8e8e;">
	                            <span style="font-weight: bold;margin-right: 10px;color: #2d2d31">
	                                <span class="label label-{$item['plugincss']} ordertype">{$item['plugintext']}</span>{if $item['pftflag'] > 0} <span class="label label-warning">票务订单</span> {/if}{php echo date('Y-m-d H:i:s',$item['createtime'])}
	                            </span>
	                            订单编号：{$item['orderno']}&nbsp;&nbsp;
	                            {if $item['refundflag'] > 0}
									<label class='label label-danger'>用户申请售后</label>
								    <a class='op' href="{php echo web_url('order/orderAfterSales/afterlist',array('keywordtype'=>1,'keyword'=>$item['orderno']))}">
										查看售后申请
									</a>
								{/if}
	                        </div>
	                        <div class='aops text-right'>
	                            {if $item['merchid'] == 0}
	                                <a class='op'  data-toggle="ajaxModal" href="{php echo web_url('order/wlOrder/remarksaler', array('id' => $item['id'],'type'=>$item['a']))}" >
	                                    {if !empty($item['remark'])}
	                                    <i class="icow icow-flag-o" style="color: #df5254;display: inline-block;vertical-align: middle" title="  查看备注"></i>
	                                    备注
	                                    &nbsp
	                                    {else}
	                                    <i class="icow icow-yibiaoji" style="color: #999;display: inline-block;vertical-align: middle" title="  添加备注" ></i>
	                                    备注
	                                    &nbsp
	                                    {/if}
	                                </a>
	                            {/if}
	                                {if empty($item['status']) && !is_store() }
                                    <a class='op'  data-toggle='ajaxModal' href="{php echo web_url('order/wlOrder/changeprice',array('id'=>$item['id'],'type'=>$item['a']))}">
                                        <i class="icow icow-gaijia" title="订单改价"  style="color: #999;display: inline-block;vertical-align: middle"></i>
                                        	订单改价
                                        &nbsp
                                    </a>
	                                <a class='op'  data-toggle='ajaxPost' href="{php echo web_url('order/wlOrder/close',array('id'=>$item['id'],'type'=>$item['a']))}" data-confirm="确认关闭订单吗？" >
	                                    <i class="icow icow-shutDown" title="关闭订单"  style="color: #999;margin-right: 3px;display: inline-block;vertical-align: middle"></i>
	                                   	        关闭订单
	                                    &nbsp
	                                </a>
	                                {/if}
	                                {if $item['status'] != 0 && $item['status'] != 3 && $item['status'] != 2 && $item['status'] != 5 && $item['status'] != 7}
	                                {if !is_store() || $_W['wlsetting']['orderset']['storerefund'] > 0}
									<a class='op'  data-toggle='ajaxModal' href="{php echo web_url('order/wlOrder/refund',array('id'=>$item['id'],'type'=>$item['a']))}">
	                                    <i class="icow icow-shutDown" title="订单退款"  style="color: #999;margin-right: 3px;display: inline-block;vertical-align: middle"></i>
	                                   	        订单退款
	                                    &nbsp
	                                </a>
	                                {/if}
									{/if}
	                        </div>
	                    </div>
	                    <div class='table-row' style="margin:0  20px">
	                        <div class="goods-des">
	                            <div style="display: -webkit-box;display: -webkit-flex;display: -ms-flexbox;display: flex;margin: 10px 0">
	                                <img src="{php echo tomedia($item['goodsimg'])}" style='width:70px;height:70px;border:1px solid #efefef; padding:1px;'onerror="this.src='../addons/{MODULE_NAME}/web/resource/images/nopic.jpg'">
	                                <div style="-webkit-box-flex: 1;-webkit-flex: 1;-ms-flex: 1;flex: 1;margin-left: 10px;text-align: left;display: flex;align-items: center">
	                                    <div>
	                                       <div class="title" {if mb_strlen($item['goodsname']) > 10} data-toggle='popover' data-html='true' data-placement='right' data-trigger="hover" data-content="<div style='width:150px;border:1px solid #efefef;padding:5px;' >{$item['goodsname']}</div>" {/if} >
	                                           {$item['goodsname']}<br/>
											   {if $item['goods_id']>0}ID:{$item['goods_id']}<br/>{/if}
	                                           <span style="color: #999"> {if !empty($item['optiontitle'])}规格：{$item['optiontitle']}{/if}</span>
												<span style="color: #999"> {if $item['plugin']  == 'hotel'}{$item['starttime']} - {$item['endtime']}{/if}</span>

										</div>
	                                    </div>
	                                    <span style="float: right;text-align: right;display: inline-block;width:130px;">
											￥{$item['goodsprice']}
											{if $item['plugin']!='citydelivery'}
											<br/>	x{$item['num']}
											{/if}
	                                    </span>
	                                </div>
	                            </div>
	                        </div>

						{if empty($_W['aid'])}
						<div class="list-inner" style='text-align: center;' >
							<div>
								{$item['agentname']}
							</div>
						</div>
						{/if}
	
	                        <div class="list-inner saler" style='text-align: center;' >
	                            <div>
	                                <a {if $_W['aid']} href="javascript:;" {else} href="{php echo web_url('member/wlMember/memberIndex',array('mid'=>$item['mid']))}" {/if} > {$item['member']['nickname']}</a>
	                                <br/>
	                                {$item['member']['realname']}<br/>{$item['member']['mobile']}<br/>MID:{$item['mid']}
	                            </div>
	                        </div>
	                        <div class="list-inner paystyle" style='text-align:center;' >
	
	                            <!-- 已支付 -->
	                            {if $item['status'] > 0 && $item['status'] != 5}
	                                {if $item['paytype']==1}
	                                   <span> <i class="icow icow-yue text-warning" style="font-size: 17px;"></i><span>余额支付</span></span>
	                                {elseif $item['paytype']==6}
	                                   <span> <i class="icow icow-kuajingzhifuiconfukuan text-danger" style="font-size: 17px"></i>0元购</span>
	                                {elseif $item['paytype']==2}
	                                   <span> <i class="icow icow-weixinzhifu text-success" style="font-size: 17px"></i>微信支付</span>
	                                {elseif $item['paytype']==3}
	                                    <span><i class="icow icow-zhifubaozhifu text-primary" style="font-size: 17px"></i>支付宝支付</span>
	                                {elseif $item['paytype']==5}
	                                    <span><i class="icow icow-zhifubaozhifu text-primary" style="font-size: 17px"></i>小程序支付</span>
	                                {elseif $item['paytype']==4}
	                                    <span><i class="icow icow-zhifubaozhifu text-primary" style="font-size: 17px"></i>货到付款</span>
	                                {elseif empty($item['paytype']) && $item['actualprice'] == 0 }
	                                    <span><i class="icow icow-zhifubaozhifu text-primary" style="font-size: 17px"></i>0元购</span>
									{elseif $item['paytype']==7}
										<span><i class="icow icow-zhifubaozhifu text-primary" style="font-size: 17px"></i>混合支付</span>
										(微信{$item['blendwx']} + 余额{$item['blendcredit']})
	                                {else}
	                              		<label class='label label-danger'>未知方式</label>
	                                {/if}
	                            {else}
	                                <!-- 未支付 -->
	                                <label class='label label-default'>未支付</label>
	                            {/if}
	                        </div>
	
	                        <a  class="list-inner" data-toggle='popover' data-html='true' data-placement='right' data-trigger="hover" data-content="<table style='width:100%;'>
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>商品小计：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>￥{php echo number_format($item['goodsprice']*$item['num'],2)}</td>
	                                    </tr>
	                                    {if $item['deposit'] > 0}
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>房间押金：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>￥{php echo number_format($item['deposit'],2)}</td>
	                                    </tr>
	                                    {/if}
	                                    {if $item['packingmoney'] > 0}
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>包装费：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>￥{php echo number_format($item['packingmoney'],2)}</td>
	                                    </tr>
	                                    {/if}
	                                    {if $item['express']['expressprice'] > 0}
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>运费：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>￥{php echo number_format($item['express']['expressprice'],2)}</td>
	                                    </tr>
	                                    {/if}
	                                    {if $item['vipCardPrice'] > 0}
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>开通会员：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>￥{$item['vipCardPrice']}</td>
	                                    </tr>
	                                    {/if}
	                                    {if $item['vipdiscount']>0}
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>会员减免：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>-￥{php echo number_format( $item['vipdiscount'],2)}</td>
	                                    </tr>
	                                    {/if}
	                                    {if $item['dkmoney']>0}
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>积分抵扣：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>-￥{php echo number_format( $item['dkmoney'],2)}</td>
	                                    </tr>
	                                    {/if}
	                                    {if $item['redpackmoney']>0}
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>红包优惠：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>-￥{php echo number_format( $item['redpackmoney'],2)}</td>
	                                    </tr>
	                                    {/if}
	                                    {if $item['fullreducemoney']>0}
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>满减优惠：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>-￥{php echo number_format( $item['fullreducemoney'],2)}</td>
	                                    </tr>
	                                    {/if}
	                                    {if $item['changeprice'] != 0}
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>卖家改价：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'><span style='{if 0<$item['changeprice']}color:green{else}color:red{/if}'>{if 0<$item['changeprice']}+{else}-{/if}￥{php echo number_format(abs($item['changeprice']),2)}</span></td>
	                                    </tr>
	                                    {/if}
	                                    {if $item['changedispatchprice'] != 0}
	                                    <tr>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'>卖家改运费：</td>
	                                        <td  style='border:none;text-align:right;padding: 5px!important;'><span style='{if 0<$item['changedispatchprice']}color:green{else}color:red{/if}'>{if 0<$item['changedispatchprice']}+{else}-{/if}￥{php echo number_format(abs($item['changedispatchprice']),2)}</span></td>
	                                    </tr>
	                                    {/if}
	                                    <tr>
	                                        <td style='border:none;text-align:right;padding: 5px!important;'>应收款：</td>
	                                        <td  style='border:none;text-align:right;color:green;padding: 5px!important;'>￥{php echo number_format($item['actualprice'],2)}</td>
	                                    </tr>
	
	                                </table>
	                    "
	                    	>
	                        	<div style='text-align:center' >
	                                	￥{php echo number_format($item['actualprice'],2)}
	                                {if $item['express']['expressprice']>0}
	                                <br/>(含运费:￥{php echo number_format( $item['express']['expressprice'],2)})
	                                {/if}
	                            </div>
	                        </a>
	
	                        <div  class="list-inner"  style='text-align:center' >
	                            <a class='op' href="{$item['detailurl']}" target='_blank' >查看详情</a>
	                            {if !empty($item['refundid'])}
	                            <a class='op' href="{php echo web_url('order/op/refund', array('id' => $item['id']))}" >维权{if $item['refundstate']>0}处理{else}详情{/if}</a>
	                            {/if}
	                            {if $item['expressid'] && !empty($item['express']['expresssn']) }
	                            <a class='op' data-toggle="ajaxModal" href="{php echo web_url('order/wlOrder/logisticsrecord',array('id' => $item['expressid']))}">物流信息</a>
								{/if}
	                            {if empty($item['expressid'])}
	                            {if ($item['status'] == 1 || $item['status'] == 2 || $item['status'] == 3 || $item['status'] == 9) && $item['plugin'] != 'citydelivery' }
	                           	 <a class='op' data-toggle="ajaxModal" href="{php echo web_url('order/wlOrder/hexiaorecord',array('id' => $item['id'],'type'=>$item['a']))}">核销记录</a>
	                            {/if}
	                            {/if}
								<!--校验分销订单-->
								{if $_W['wlsetting']['distribution']['switch'] && empty($item['disorderid']) && empty($item['isdistri']) && ($item['status'] != 5) && ($item['status'] != 0) && ($item['status'] != 9)}
								<a class='op'  data-toggle='ajaxPost' href="{php echo web_url('order/wlOrder/createdisorder',array('id'=>$item['id'],'type'=>$item['a']))}" data-confirm="确认生成相关分销订单？" >生成分销订单</a>
								{/if}
	                        </div>
	
	                        <div  class='ops list-inner' style='line-height:20px;text-align:center' >
	                            <span class='label label-{$item['statuscss']}'>{$item['statustext']}</span>{php include wl_template('order/orderops');}
	                        </div>
	
	                    </div>
			            {if !empty($item['buyremark'])}
			            <div class="table-row"><div class="buyremark">买家备注: {$item['buyremark']}</div></div>
			            {/if}
						{if !empty($item['remark'])}
			            <div class="table-row"><div class="remark">卖家备注: {$item['remark']}</div></div>
			            {/if}

			            <div class="table-footer table-row">
			                <div style='text-align:left'>
			                   	 商户名称：<span class="text-info">{$item['merchname']}</span>
								{if $item['disorderid']}<b>分销订单级别:</b> {$item['level']}级 <b>分销佣金:</b> {$item['commission']} 元{/if}
			                </div>
							{if $item['disorderid']}
			                <div style='text-align:right'>
				               	<b>1级佣金:</b>[{$item['onecomname']}](mid:{$item['onecommid']}) {$item['onecommission']} 元
				                {if $item['twocommission']}<b>2级佣金:</b>[{$item['twocomname']}](mid:{$item['twocommid']}) {$item['twocommission']} 元 {/if}
			                    {if !is_agent() && !is_store() && empty($item['disorderstatus']) }
			                    <a class="text-primary" data-toggle="ajaxModal"  href="{php echo web_url('order/wlOrder/changecommission', array('id' => $item['disorderid']))}">修改佣金</a>
			                    {/if}
			                </div>
							{/if}
			            </div>
			            {if $item['onegroupmoney'] > 0}
			            <div class="table-footer table-row">
			                <div style='text-align:left'>
			                   	<b>直属团长分红：</b>[{$item['onegroupname']}](mid:{$item['onegroupmid']}) {$item['onegroupmoney']} 元
			                   	{if $item['twogroupmoney'] > 0}<b>上级团长分红：</b>[{$item['twogroupname']}](mid:{$item['twogroupmid']}) {$item['twogroupmoney']} 元 {/if}
			                </div>
							{if $item['onegroupmoney'] > 0}
			                <div style='text-align:right'>
				               	<b>股东分红:</b>{$item['shareholdermoney']} 元
			                </div>
							{/if}
			            </div>
			            {/if}
			            
		            </div>
	            	{/loop}
	                <div style="padding: 20px 0;text-align: right" >
	                    {$pager}
	                </div>
	            </div>
	        </div>
	   	</div>
	</div>	
</div>
<script>
    $("#excelUpload").on('change',function () {
        var val = $("#excelUpload").get(0).files[0];//文件内容
        var type = val['name'].split(".");//文件名称+文件后缀
        type = $.trim(type[type.length - 1]);//文件后缀
        $("#excelUpload").val('');
        if(type == 'csv'){
            var fd = new FormData();
            fd.append("file",val);//上传的文件file
            tip.confirm("内容处理中，请不要刷新页面/离开页面!<br />确定后开始处理",function () {
                $.ajax({
                    url:"{php echo web_url('order/wlOrder/bulkShipment')}",
                    type:"post",
                    data:fd,
                    dataType:"json",
                    cache: false,
                    processData: false,
                    contentType: false,
                    async:false,
                    success:function(data){
                        tip.alert(data.message,function () {
                            if(data.errno == 1){
                                var url = "{php echo web_url('order/wlOrder/batchSend')}"+"name="+data.data;
                                window.location.href = url;
                            }
                        });
                    },
                    error:function(){
                        tip.alert("网络错误，请重试！！");
                    }
                });
            });
        }else{
            tip.alert("只能上传csv类型的表格文件");
        }
    });
</script>
{php include wl_template('common/footer');}